package com.xsmart.common.services;

import com.xsmart.common.constant.RedisKeyConstant;
import com.xsmart.common.util.RedisUtil;
import com.xsmart.common.entity.ApiInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class GetApiInfoService {
    private static Map<String, Map<String, String>> mAPIInfoMap;
    @Autowired
    private RedisUtil redisUtil;

    public ApiInfo getApiInfo(String methodUri) {
        Map<String, String> apiInfoMap = redisUtil.getHashByKey(RedisKeyConstant.API_INFO_PREFIX + methodUri);
        return new ApiInfo(apiInfoMap);
    }
}
